export const reportEvent = (eventId, eventData) => {
  if (!eventId) {
    return;
  }
  // console.log("reportEvent:", eventId);
  wx.reportEvent(eventId, eventData);
};

export const EVENT_ID = {
  CATEGORY: {
    SHANG_CHENG: "shangcheng", // 商城页
    BU_FAN_ZHEN_XUAN: "bufanzhenxuan", // 不凡甄选
    RI_CHANG_XIAO_ZHUO: "richangxiaozhuo", // 日常小酌
    MIAN_SHUI_ZHUAN_GONG: "mianshuizhuangong", // 免税专供
    CUI_CAN_XI_LIE: "cuicanxilie", // 璀璨系列
    SHANG_CHENG_YE_FANG_WEN: "shangchengyefangwen", // 商城页访问
  },
};

export const getEventIdByNavName = (navName) => {
  const {
    BU_FAN_ZHEN_XUAN,
    RI_CHANG_XIAO_ZHUO,
    CUI_CAN_XI_LIE,
    MIAN_SHUI_ZHUAN_GONG,
  } = EVENT_ID.CATEGORY;
  switch (navName) {
    case "不凡甄选":
      return BU_FAN_ZHEN_XUAN;
    case "日常小酌":
      return RI_CHANG_XIAO_ZHUO;
    case "璀璨系列":
      return CUI_CAN_XI_LIE;
    case "免税专供":
      return MIAN_SHUI_ZHUAN_GONG;
    default:
      return "";
  }
};
